package com.fastMq.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fastMq.model.ResultRespone;
import com.fastMq.model.User;
import com.fastMq.service.PushService;

@Controller  
@RequestMapping("/push")  
public class PushController {
	
	@Resource(name="userPushService")  
    private PushService userPushService;  
      
    /** 
     * 用户推送 
     * @param info 
     * @return 
     * @author Administrator 
     * @create 2016-8-10 下午4:22:28 
     */  
    @RequestMapping(value="/user",method=RequestMethod.POST)  
    @ResponseBody  
    public ResultRespone userPush(User info){  
        ResultRespone respone = new ResultRespone();  
        try {  
            userPushService.push(info);  
            respone.setData(info);  
        } catch (Exception e) {  
            e.printStackTrace();  
            respone = new ResultRespone(false, e.getMessage());  
        }  
        return respone;  
    }  

}
